// author: shelman
// description：封装了HTTP服务示例的接口
#pragma once

#include "civetweb/CivetServer.h"
#include "export_def.h"

// 定义Websocket基础类
class API_EXPORT_DECL HttpServerBaseHandler : public CivetHandler
{
public:
    void setUrl(std::string strUrl);
    std::string getUrl() const;

    bool handleGet(CivetServer *server, struct mg_connection *conn) override;
    bool handlePost(CivetServer *server, struct mg_connection *conn) override;

protected:
    std::string m_strUrl = "";
};

// 示例XXX的类
class API_EXPORT_DECL Example1HttpServerHandler : public HttpServerBaseHandler
{
public:
    Example1HttpServerHandler();
    virtual ~Example1HttpServerHandler() override;

    bool handleGet(CivetServer *server, struct mg_connection *conn) override;
    bool handlePost(CivetServer *server, struct mg_connection *conn) override;
};


